#include "widget.h"
#include "ui_widget.h"



Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    this->setFixedSize(660,900);

    this->m_play=new MainWindow();

    connect(ui->pushButton_begin,&QPushButton::clicked,[=](){
        //设置窗口和上级的窗口的位置一致
        this->setGeometry(this->geometry());
        //隐藏当前窗口
         this->hide();
         m_play->show();

    });
    connect(ui->pushButton_exit,&QPushButton::clicked,[=](){

        this->close();
    });
    //监听下级窗口 发送的返回信号
    connect(this->m_play,&MainWindow::chooseback,[=](){
        this->setGeometry(this->m_play->geometry());
        this->show();
        this->m_play->hide();
    });
}

Widget::~Widget()
{
    delete ui;
    delete m_play;
}
